

#ifndef MY_GFILEEXISTS
#define MY_GFILEEXISTS

#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif

BOOL gFileExists(PCWSTR szPath)
{
  DWORD dwAttrib = GetFileAttributesW(szPath);
  return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
	         !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
}		


#endif